Motion.SetAxisCam method
Links the axes and starts to cam.
Namespace: IntervalZero.KINGSTAR.OpcUa.Api
Assembly: IntervalZero.KINGSTAR.OpcUa.Api (in IntervalZero.KINGSTAR.OpcUa.Client.dll) Version: 4.4.0.0
Syntax
public KsCommandStatus SetAxisCam(
int Master,
int Slave,
bool Permanent,
double MasterOffset,
double SlaveOffset,
double MasterScaling,
double SlaveScaling,
McCamStartMode StartMode,
double StartParameter,
McSource MasterValueSource,
int Cam,
McBufferMode BufferMode
)
Public Function SetAxisCam(
Master As Integer,
Slave As Integer,
Permanent As Boolean,
MasterOffset As Double,
SlaveOffset As Double,
MasterScaling As Double,
SlaveScaling As Double,
StartMode As McCamStartMode,
StartParameter As Double,
MasterValueSource As McSource,
Cam As Integer,
BufferMode As McBufferMode
) As KsCommandStatus
Parameters
Master [in]
Type: int
The index of the master axis. Indexes are zero based. Aliases affect this parameter.
Slave [in]
Type: int
The index of the slave axis. Indexes are zero based. Aliases affect this parameter. The number of slaves is up to 32.
Permanent [in]
Type: bool
Determines whether the cam state is preserved after the motor is disabled.
true: The cam state is preserved even if the motor is disabled. For example, if the master axis is enabled, the slave axis will be enabled. If an error has occurred on the master, it occurred on the slave too.
false: The cam state won't be preserved after the motor is disabled.
MasterOffset [in]
Type: double
The offset to the positions of the master axis in the cam table.
SlaveOffset [in]
Type: double
The offset to the positions of the slave axis in the cam table.
MasterScaling [in]
Type: double
The factor for the master profile (default = 1.0). From the slave point of view the overall master profile is multiplied by this factor.
SlaveScaling [in]
Type: double
The factor for the slave profile (default = 1.0). The overall slave profile is multiplied by this factor.
StartMode [in]
Type: McCamStartMode
The cam mode your axes use.
StartParameter [in]
Type: double
Depends on the start ramp you choose. If it is camRampDistance
, StartParameter is the distance the slave moves. The unit is count. If it is camRampTime
, StartParameter is the time the slaves takes to move. The unit is second. This parameter uses the master's information to determine how to move the slave. The distance is based on how far the master moves.
MasterValueSource [in]
Type: McSource
Defines the source for synchronization.
- mcSetValue – synchronization on master set value. We suggest you use these settings.
- mcActualValue – synchronization on master actual value. This setting may not be stable.
- mcSecondEncoderValue – actual value of the secondary encoder of the axis.
NOTE: mcSecondEncoderValue is not supported yet.
Cam [in]
Type: int
The index of the cam table, linked to the output of SetCamTable.
BufferMode [in]
Type: McBufferMode
Defines how to blend the velocity of two methods.
Return value
Type: KsCommandStatus
Returns the KsCommandStatus class.
Remarks
- For more information about how a cam works, see Concepts > Camming.
- It is not required that the master is stationary.
- If the actual master and slave positions do not correspond to the offset values when SetAxisCam is run, either an error occurs or the system deals with the difference automatically.
- This method is not merged with the SetCamTable, because this separation enables changes on the fly.
- A mechanical analogy to a slave offset is a cam welded with additional constant layer thickness. Because of this, the slave positions have a constant offset and the offset can be interpreted as axis offset of the master shaft, if linear guided slave tappets are assumed.
- To detach the slave axis, use ReleaseAxis.
- SetAxisCam is not affected when modulo axis is enabled. The axis doesn't treat positions in the cam table as modulo positions. For example, assume the master and slave axes are synchronized, and both are configured with a modulo value of 360. The next MasterPosition and SlavePosition in the cam table are set to 360 and 540, respectively. In this case, the master axis will rotate 1 cycle, while the slave axis will rotate 1.5 cycles to reach the configured position. After enabling modulo axis, we recommend that users:
- Use SetAxisPositionOffset to reset the position, preventing discrepancies between the displayed and internal positions. For example, when the modulo axis value is set to 360, the user might see a position of 0, while the internal position is 360000.
- Use velocity or distance APIs to move master axis.
Examples
N/A
See also